import request from '@/utils/request';

/**
 * 查询客户端管理列表
 * @param query
 * @returns {*}
 */

export const listClient = (query) => {
	return request({
		url: '/system/client/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询客户端管理详细
 * @param id
 */
export const getClient = (id) => {
	return request({
		url: '/system/client/' + id,
		method: 'get'
	});
};

/**
 * 新增客户端管理
 * @param data
 */
export const addClient = (data) => {
	return request({
		url: '/system/client',
		method: 'post',
		data: data
	});
};

/**
 * 修改客户端管理
 * @param data
 */
export const updateClient = (data) => {
	return request({
		url: '/system/client',
		method: 'put',
		data: data
	});
};

/**
 * 删除客户端管理
 * @param id
 */
export const delClient = (id) => {
	return request({
		url: '/system/client/' + id,
		method: 'delete'
	});
};

/**
 * 状态修改
 * @param clientId 客户端id
 * @param status 状态
 */
export function changeStatus (clientId) {
	const data = {
		clientId,
		status
	};
	return request({
		url: '/system/client/changeStatus',
		method: 'put',
		data: data
	});
}
